/**
 * 
 */
package br.srv.full.virtual.entities.log;

import java.io.Serializable;

import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import br.srv.full.virtual.entities.auth.Login;

/**
 * @author Delfino
 * 
 */
@Entity
@DiscriminatorValue(value = "1")
public class SiteUseControl extends LogControl implements Serializable {

	@ManyToOne(targetEntity = Login.class, optional = false, fetch = FetchType.EAGER)
	@JoinColumn(name = "loginid", referencedColumnName = "loginid")
	private Login login;
	
	public SiteUseControl(){
		super("Uso do Site!");
	}

	public SiteUseControl(String p_msg ){
		super(p_msg);
	}
	
	public SiteUseControl(String p_tag,String p_msg){
		super(p_tag,p_msg);
	}

	public SiteUseControl(Login p_login, String p_tag, String p_msg){
		super(p_tag,p_msg);
		setLogin(p_login);
	}

	public SiteUseControl(Login p_login, String p_msg){
		super(p_msg);
		setLogin(p_login);
	}
	/**
	 * @param p_userLogin
	 */
	public SiteUseControl(Login p_userLogin) {
		login = p_userLogin;
	}

	/**
	 * @return the login
	 */
	public Login getLogin() {
		return login;
	}

	/**
	 * @param p_login
	 *            the login to set
	 */
	public void setLogin(Login p_login) {
		login = p_login;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return getLogin() + " Log: "+ super.toString();
	}
}
